// pages/nine/nine.js
const request=require("../../utils/request")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    slides:[],
    categories:[],

    indicatorDots: true,
    vertical: false,
    autoplay:true,
    interval: 2000,
    duration: 500
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.setNavigationBarTitle({
      title: '我的家',
    }),
    request("/slides").then(res=>{
      console.log(res.data)
      this.setData({
        slides: res.data
      })
    }),
      request("/categories").then(res => {
        console.log(res.data)
        this.setData({
          categories: res.data
        })
      })
  }
})
